Bentley Map V8i (SELECTseries 10) Help

Using Scripts for Spatial Analysis

Scripting can make spatial analysis by executing one script and make it call another script. This procedure only runs on the graphical elements that satisfy the spatial operator (INSIDE, OUTSIDE, NEAR, etc.) as well as the SETUP filter.

In order to perform spatial analyses, at least two scripts must be defined in the .GSF file.

  • The “spatial script” finds the “spatial elements.”

  • The “master script” finds the “master elements” and calls the spatial script using a spatial operator.

The second script finds the master elements based on the normal SETUP filters. For each master element, it then calls the spatial script using the EXECUTE command with a spatial operator. The graphical elements are filtered by the spatial script using both the normal SETUP filters and the spatial operator.

Example:



In this example the first script “find_lines” finds the lines and modifies their symbology. It also increments the “line_count” variable each time a spatial element is validated.

The second script finds all circles. For each circle it then calls the “find_lines” script but instead of having this script run on a fence or a view, it runs only on the elements that are INSIDE the current circle.

The result is that all lines enclosed by a circle (and only these) are resymbolized.

The master script also prints the number of lines found within the current circle using the “line_count” variable. The spatial script has to EXPORT its changes to this variable in order to make the changes visible in the master script.

The script provides the following spatial operators that can be used with the EXECUTE command.

Note: There is no limit of only two scripts. It is possible to have a master script that calls one or more spatial scripts. Each of these spatial scripts can call other spatial scripts. However, the processing time increases rapidly with the number of spatial analyses. The master script and the spatial script have their own set of variables. If required, It is possible to modify master variables from the spatial script, these variables must be exported using the EXPORT command.